#ifndef CLICKABLE_MENU_H
#define CLICKABLE_MENU_H

#include <QMenu>
#include <QMouseEvent>
#include <QDebug>

class ClickableMenu : public QMenu
{
    Q_OBJECT
public:
    // 构造函数
    explicit ClickableMenu(const QString &title, QWidget *parent = nullptr);

signals:
    // 菜单被点击时发出的信号
    void menuClicked();

protected:
    void mousePressEvent(QMouseEvent *event) override;
    // 重写鼠标释放事件，检测菜单点击
    void mouseReleaseEvent(QMouseEvent *event) override;

};

#endif // CLICKABLE_MENU_H
